package net.tngou.crawler.validate;

import java.util.regex.Pattern;

import org.jsoup.nodes.Document;

import net.tngou.c4j.CollectionGenerator;
import net.tngou.c4j.Fetcher;
import net.tngou.c4j.util.UrlRegex;
import net.tngou.crawler.util.StringUtil;

/**
 * 
 * @author tngou@tngou.net
 *
 */
public class PageVerification {

	public static void main(String[] args) {
		String url="https://www.women-health.cn/Health-knowledge/0125204T2018_2.html";
		Document doc = CollectionGenerator.get(url);
//		String field="class[content][0]";
//		String value = Fetcher.getValue(doc.body(), field);
//		System.err.println(value);
		System.err.println(doc);
//		
//		String sql="https://www.women-health.cn/Health-knowledge/${}_${}.html";
//		String[] st = StringUtil.split(sql, "${}");
//		for (String string : st) {
//			url=StringUtil.replace(url, string, "|", 1);			
//		}
//		
//		System.err.println(url);
		
//		UrlRegex regex = new UrlRegex();
//		String[] sts = regex.get("https://www.women-health.cn/Health-knowledge/0105115O2016_2.html", "https://www.women-health.cn/Health-knowledge/${}_${}.html");
//		System.err.println(sts[0]+"_"+sts[1]);
		//		String url ="https://www.women-health.cn/Health-knowledge/012H054R018.html";
//		boolean b = Pattern.matches("^https://www.women-health.cn/Health-knowledge/+(.*)", url );
//		System.err.println(b);
		
	}
}
